var fourSumCount = function(nums1, nums2, nums3, nums4) {
    let count=0,map=new Map()
    for(let a1 of nums1){
        for(a2 of nums2){
            let sum=a1+a2
        map.has(sum)?map.set(sum,map.get(sum)+1):map.set(sum,1)
        }
    }

    for(let a3 of nums3){
        for(let a4 of nums4){
           let sum=a3+a4
           count+=map.get(-sum)||0
        }
    }

return count

};